#import "OrderNewsCollectionViewCell.h"
@implementation OrderNewsCollectionViewCell
- (void)awakeFromNib {
    [super awakeFromNib];
    self.labNickname.shadowColor = [UIColor blackColor];    
    self.labNickname.shadowOffset = CGSizeMake(1.0f, 1.0f);     
    self.status.backgroundColor = UIColorFromRGBA(0x1F1F1,0.5);
    self.charging.backgroundColor = UIColorFromRGBA(0x1F1F1,0.5);
    self.headImage.layer.cornerRadius = 10;
    self.headImage.layer.masksToBounds = YES;
    self.goodNum.hidden = YES;
}
- (void)setModel:(OrderModel *)personModel
{
    if(KIOSBASE)
    {
        self.headImage.image = [[CYCommon sharedCYCommon] getKatongImageWidthID:personModel.id];
    }
    else
    {
        [self.headImage sd_setImageWithURL:[[CYURLUtils sharedCYURLUtils] safeUrl:personModel.avatar] placeholderImage:[[CYCommon sharedCYCommon] getEpmayImage]];
    }
    self.headImage.contentMode = UIViewContentModeScaleAspectFill;
    self.labNickname.text = personModel.user_nickname;
    [self.level setTitle:personModel.level forState:UIControlStateNormal];
    [self.level setImage:IMAGE_NAMED(@"mine_level_05") forState:UIControlStateNormal];
    self.level.backgroundColor = MainColor;
    self.level.contentEdgeInsets = UIEdgeInsetsMake(2, 3, 2, 3);
    self.level.imageView.clipsToBounds = YES;
    self.level.imageView.contentMode = UIViewContentModeScaleAspectFill;
    self.level.spacingBetweenImageAndTitle = 0;
    UIImage *radImage = [[UIImage imageWithColor:MainColor size:CGSizeMake(3, 3)] imageByRoundCornerRadius:1.5];
    if (personModel.is_live || personModel.is_lives) {
        [self.status setTitle:ASLocalizedString(@"直播中")forState:UIControlStateNormal];
        radImage = [[UIImage imageWithColor:[UIColor colorWithHexString:@"FF0000"] size:CGSizeMake(3, 3)] imageByRoundCornerRadius:1.5];
    } else if([personModel.is_online isEqualToString:@"1"]) {
        [self.status setTitle:ASLocalizedString(@"在线")forState:UIControlStateNormal];
        radImage = [[UIImage imageWithColor:[UIColor colorWithHexString:@"3CE280"] size:CGSizeMake(3, 3)] imageByRoundCornerRadius:1.5];
    } else {
        [self.status setTitle:ASLocalizedString(@"离线")forState:UIControlStateNormal];
        radImage = [[UIImage imageWithColor:[UIColor colorWithHexString:@"C6C6C6"] size:CGSizeMake(3, 3)] imageByRoundCornerRadius:1.5];
    }
    [self.status setImage:radImage forState:UIControlStateNormal];
    self.status.spacingBetweenImageAndTitle = 2;
        [self.charging setTitle:[NSString stringWithFormat:@"¥%@", personModel.charging_coin] forState:UIControlStateNormal];
        self.charging.spacingBetweenImageAndTitle = 2;
}
@end
